﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Manage/MasterPage.master" AutoEventWireup="true" CodeFile="EditTopic.aspx.cs" Inherits="EditTopic" %>
<%@ Register Src="~/Manage/CmsMessageBox.ascx" TagName="MessageBox" TagPrefix="cms" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <script type="text/javascript">
        $(document).ready(function () {
            $('#<%=SelectParent.ClientID %>').click(function () {
                var v = showModalDialog('./TopicTree.aspx', null, 'dialogWidth:400px;dialogHeight:320px;center:yes;help:yes;resizable:yes;status:no');
                var vs = v.split('|');

                if (vs[0] == 'null') {
                    $('#<%=NameLabel.ClientID %>').text('请选择');
                    $('#<%=ParentTopicID.ClientID %>').val('');
                } else {
                    $('#<%=NameLabel.ClientID %>').text(vs[1]);
                    $('#<%=ParentTopicID.ClientID %>').val(vs[0]);
                }

                return false;
            });

            $('#<%=Save.ClientID %>').click(function () {
                var ds = [{ 'Controller': '#<%=TopicName.ClientID %>',
                    'Type': 'R',
                    'ErrorMessage': '请输入栏目名称。',
                    'Clear': true,
                    'Focus': true}
                     ];

                return Cms_ValidateForm(ds);
            });
        });
    </script></asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="body" Runat="Server">

    <cms:MessageBox ID="Message" runat="server" />
    <asp:HiddenField ID="TopicID" runat="server" />
    <table class="Info" cellspacing="1">
        <tr>
            <td align="right" style="width: 100px">栏目名称：</td>
            <td align="center"><asp:TextBox ID="TopicName" runat="server" Width="300px" CssClass="text"></asp:TextBox></td>
        </tr>
        <tr>
            <td align="right">父栏目：</td>
            <td>
                <label id="NameLabel" runat="server">请选择</label><asp:HiddenField ID="ParentTopicID" runat="server" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Button ID="SelectParent" runat="server" Text="选择" />
            </td>
        </tr>
        <tr>
            <td align="right">栏目描述：</td>
            <td align="center"><asp:TextBox ID="TopicDescription" runat="server" TextMode="MultiLine" Width="300px" Height="100px" SkinID="MultiLineTextBox"></asp:TextBox></td>

        </tr>
        <tr>
            <td colspan="2" align="center">
                <asp:Button ID="Save" runat="server" Text="保存" 
                    onclick="Save_Click" CssClass="Button" /></td>
        </tr>
    </table>
</asp:Content>

